# (C) Datadog, Inc. 2024-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)

MOCKED_PROMETHEUS_METRICS = [
    "fly_io.instance.cpu.count",
    "fly_io.instance.disk.io_in_progress",
    "fly_io.instance.disk.reads_completed.count",
    "fly_io.instance.disk.reads_merged.count",
    "fly_io.instance.disk.sectors_read.count",
    "fly_io.instance.disk.sectors_written.count",
    "fly_io.instance.disk.time_io.count",
    "fly_io.instance.disk.time_io_weighted.count",
    "fly_io.instance.disk.time_reading.count",
    "fly_io.instance.disk.time_writing.count",
    "fly_io.instance.disk.writes_completed.count",
    "fly_io.instance.disk.writes_merged.count",
    "fly_io.instance.filefd.allocated",
    "fly_io.instance.filefd.max",
    "fly_io.instance.filesystem.block_size",
    "fly_io.instance.filesystem.blocks",
    "fly_io.instance.filesystem.blocks_avail",
    "fly_io.instance.filesystem.blocks_free",
    "fly_io.instance.load.avg",
    "fly_io.instance.memory.active",
    "fly_io.instance.memory.buffers",
    "fly_io.instance.memory.cached",
    "fly_io.instance.memory.dirty",
    "fly_io.instance.memory.inactive",
    "fly_io.instance.memory.mem_available",
    "fly_io.instance.memory.mem_free",
    "fly_io.instance.memory.mem_total",
    "fly_io.instance.memory.shmem",
    "fly_io.instance.memory.slab",
    "fly_io.instance.memory.swap_cached",
    "fly_io.instance.memory.swap_free",
    "fly_io.instance.memory.swap_total",
    "fly_io.instance.memory.vmalloc_chunk",
    "fly_io.instance.memory.vmalloc_total",
    "fly_io.instance.memory.vmalloc_used",
    "fly_io.instance.memory.writeback",
    "fly_io.instance.net.recv_bytes.count",
    "fly_io.instance.net.recv_compressed.count",
    "fly_io.instance.net.recv_drop.count",
    "fly_io.instance.net.recv_errs.count",
    "fly_io.instance.net.recv_fifo.count",
    "fly_io.instance.net.recv_frame.count",
    "fly_io.instance.net.recv_multicast.count",
    "fly_io.instance.net.recv_packets.count",
    "fly_io.instance.net.sent_bytes.count",
    "fly_io.instance.net.sent_carrier.count",
    "fly_io.instance.net.sent_colls.count",
    "fly_io.instance.net.sent_compressed.count",
    "fly_io.instance.net.sent_drop.count",
    "fly_io.instance.net.sent_errs.count",
    "fly_io.instance.net.sent_fifo.count",
    "fly_io.instance.net.sent_packets.count",
    "fly_io.instance.up",
    "fly_io.instance.memory.pressure_full",
    "fly_io.instance.memory.pressure_some",
]

PROMETHEUS_METRICS_ONE_HOST = [
    "fly_io.app.connect_time.bucket",
    "fly_io.app.connect_time.count",
    "fly_io.app.connect_time.sum",
    "fly_io.app.http_response_time.bucket",
    "fly_io.app.http_response_time.count",
    "fly_io.app.http_response_time.sum",
]

PROMETHEUS_METRICS_NO_HOST = [
    "fly_io.edge.http_response_time.bucket",
    "fly_io.edge.http_response_time.count",
    "fly_io.edge.http_response_time.sum",
    "fly_io.edge.tls_handshake_time.bucket",
    "fly_io.edge.tls_handshake_time.count",
]
ALL_PROMETHEUS_METRICS = MOCKED_PROMETHEUS_METRICS + PROMETHEUS_METRICS_NO_HOST + PROMETHEUS_METRICS_ONE_HOST
ALL_REST_METRICS = [
    'fly_io.app.count',
    'fly_io.machine.count',
    'fly_io.machines_api.up',
    'fly_io.machine.cpus.count',
    'fly_io.machine.gpus.count',
    'fly_io.machine.memory',
    'fly_io.machine.swap_size',
    'fly_io.volume.created',
    'fly_io.volume.size',
    'fly_io.volume.encrypted',
    'fly_io.volume.blocks.count',
    'fly_io.volume.block_size',
    'fly_io.volume.blocks_free',
    'fly_io.volume.blocks_avail',
]

APP_UP_METRICS = [
    {
        'name': 'fly_io.app.count',
        'count': 1,
        'value': 1,
        'tags': [
            'app_name:example-app-1',
            'app_id:o7vx1kl85749k3f1',
            'app_network:default',
            'app_status:deployed',
            'fly_org:test',
        ],
    },
    {
        'name': 'fly_io.app.count',
        'count': 1,
        'value': 1,
        'tags': [
            'app_name:example-app-4',
            'app_id:z4k69d4wp2n5js93',
            'app_network:default',
            'app_status:deployed',
            'fly_org:test',
        ],
    },
    {
        'name': 'fly_io.app.count',
        'count': 1,
        'value': 1,
        'tags': [
            'app_name:example-app-2',
            'app_id:4840jpkjkxo1ei63',
            'app_network:default',
            'app_status:deployed',
            'fly_org:test',
        ],
    },
    {
        'name': 'fly_io.app.count',
        'count': 1,
        'value': 1,
        'tags': [
            'app_name:example-app-3',
            'app_id:zg90akwdv84qvd47',
            'app_network:default',
            'app_status:deployed',
            'fly_org:test',
        ],
    },
]

MACHINE_COUNT_METRICS = [
    {
        'name': 'fly_io.machine.count',
        'count': 1,
        'value': 1,
        'tags': [
            'app_id:o7vx1kl85749k3f1',
            'app_name:example-app-1',
            'fly_org:test',
            'fly_platform_version:v2',
            'instance_id:POSJ7Y49KSI6PG1H7KPKJN5IK',
            'machine_region:ewr',
        ],
    },
    {
        'name': 'fly_io.machine.count',
        'count': 1,
        'value': 1,
        'tags': [
            'app_id:o7vx1kl85749k3f1',
            'app_name:example-app-1',
            'fly_org:test',
            'fly_platform_version:v2',
            'instance_id:01AP4Y49KSI6PG1H7KPKJN5GF',
            'machine_region:ewr',
        ],
    },
]


MACHINE_GUEST_METRICS = [
    {
        'name': 'fly_io.machine.cpus.count',
        'count': 1,
        'value': 1,
        'tags': ['fly_org:test', 'cpu_kind:shared'],
        'hostname': '32601eaad60025',
    },
    {
        'name': 'fly_io.machine.gpus.count',
        'count': 1,
        'value': 2,
        'tags': ['fly_org:test', 'gpu_kind:shared'],
        'hostname': '09201eeed60025',
    },
    {
        'name': 'fly_io.machine.memory',
        'count': 1,
        'value': 1024,
        'tags': [
            'fly_org:test',
        ],
        'hostname': '32601eaad60025',
    },
]

MACHINE_INIT_METRICS = [
    {
        'name': 'fly_io.machine.swap_size',
        'count': 1,
        'value': 30,
        'tags': [
            'fly_org:test',
        ],
        'hostname': '09201eeed60025',
    }
]

VOLUME_METRICS = [
    {
        'name': 'fly_io.volume.created',
        'count': 1,
        'value': 1,
        'tags': [
            'app_name:example-app-1',
            'attached_machine_id:None',
            'fly_org:test',
            'fly_region:ewr',
            'fly_zone:4bb3',
            'fstype:ext4',
            'volume_id:vol_vtuasw00k2xpkxyv',
            'volume_name:my_app_vol',
        ],
    },
    {
        'name': 'fly_io.volume.size',
        'count': 1,
        'value': 1,
        'tags': [
            'app_name:example-app-1',
            'attached_machine_id:None',
            'fly_org:test',
            'fly_region:ewr',
            'fly_zone:4bb3',
            'fstype:ext4',
            'volume_id:vol_vtuasw00k2xpkxyv',
            'volume_name:my_app_vol',
        ],
    },
    {
        'name': 'fly_io.volume.encrypted',
        'count': 1,
        'value': 1,
        'tags': [
            'app_name:example-app-1',
            'attached_machine_id:None',
            'fly_org:test',
            'fly_region:ewr',
            'fly_zone:4bb3',
            'fstype:ext4',
            'volume_id:vol_vtuasw00k2xpkxyv',
            'volume_name:my_app_vol',
        ],
    },
    {
        'name': 'fly_io.volume.created',
        'count': 1,
        'value': 0,
        'tags': [
            'app_name:example-app-1',
            'attached_machine_id:None',
            'fly_org:test',
            'fly_region:ewr',
            'fly_zone:4bb3',
            'fstype:None',
            'volume_id:vol_vtuasw00k2xuai',
            'volume_name:my_app_vol1',
        ],
    },
    {
        'name': 'fly_io.volume.blocks.count',
        'count': 1,
        'value': 0,
        'tags': [
            'app_name:example-app-1',
            'attached_machine_id:None',
            'fly_org:test',
            'fly_region:ewr',
            'fly_zone:4bb3',
            'fstype:None',
            'volume_id:vol_vtuasw00k2xuai',
            'volume_name:my_app_vol1',
        ],
    },
    {
        'name': 'fly_io.volume.encrypted',
        'count': 1,
        'value': 0,
        'tags': [
            'app_name:example-app-1',
            'attached_machine_id:None',
            'fly_org:test',
            'fly_region:ewr',
            'fly_zone:4bb3',
            'fstype:None',
            'volume_id:vol_vtuasw00k2xuai',
            'volume_name:my_app_vol1',
        ],
    },
    {
        'name': 'fly_io.volume.block_size',
        'count': 1,
        'value': 0,
        'tags': [
            'app_name:example-app-1',
            'attached_machine_id:None',
            'fly_org:test',
            'fly_region:ewr',
            'fly_zone:4bb3',
            'fstype:ext4',
            'volume_id:vol_vtuasw00k2xpkxyv',
            'volume_name:my_app_vol',
        ],
    },
    {
        'name': 'fly_io.volume.blocks_free',
        'count': 1,
        'value': 0,
        'tags': [
            'app_name:example-app-1',
            'attached_machine_id:None',
            'fly_org:test',
            'fly_region:ewr',
            'fly_zone:4bb3',
            'fstype:ext4',
            'volume_id:vol_vtuasw00k2xpkxyv',
            'volume_name:my_app_vol',
        ],
    },
    {
        'name': 'fly_io.volume.blocks_avail',
        'count': 1,
        'value': 0,
        'tags': [
            'app_name:example-app-1',
            'attached_machine_id:None',
            'fly_org:test',
            'fly_region:ewr',
            'fly_zone:4bb3',
            'fstype:ext4',
            'volume_id:vol_vtuasw00k2xpkxyv',
            'volume_name:my_app_vol',
        ],
    },
]
